<template>
  <div class='container'>
      <el-dialog
      title="题目审核"
      :visible.sync="dialogFormVisible"
      width="30%"
      append-to-body
      backgroundColor="blue"
      style="margin-left:10px"
      >
        <el-form ref="chkform" :model='chkform' :rules="ruleInline">
        <el-form-item label="" style="text-align:left" prop="chkState">
          <el-radio-group v-model="chkform.chkState">
            <el-radio :label="1">通过</el-radio>
            <el-radio :label="2">拒绝</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="" prop="chkRemarks">
          <el-input type="textarea" v-model="chkform.chkRemarks" placeholder="请输入意见"></el-input>
        </el-form-item>
        </el-form>
        <span>
          <el-button @click="dialogFormVisible = false">取 消</el-button>
          <el-button type="primary" @click="hConfirm">确 定</el-button>
        </span>
      </el-dialog>
  </div>
</template>

<script>
import { choiceCheck } from '@/api/hmmm/questions'
export default {
  props: {
    chkform: {
      type: Object
    }
  },
  data () {
    return {
      dialogFormVisible: false,
      // 表单验证
      ruleInline: {
        chkState: [
          { required: true, message: '必选', trigger: 'blur' }
        ],
        chkRemarks: [
          { required: true, message: '此处不能为空', trigger: 'blur' }
        ]
      }
    }
  },
  methods: {
    // 弹层显示
    dialogFormV () {
      this.dialogFormVisible = true
    },
    // 弹层隐藏
    dialogFormH () {
      this.dialogFormVisible = false
    },
    async hConfirm () {
      this.dialogFormH()
      const data = {
        ...this.chkform
      }
      await choiceCheck(data).then(() => {
        this.$emit('detailQues', this.chkform)
      })
    }
  }
}
</script>

<style scoped lang='scss'></style>
